package com.zw.yzk.kabu.internal.module;

import com.zw.yzk.kabu.data.repository.GoodsDetailsRepository;
import com.zw.yzk.kabu.domain.executor.ExecutionThread;
import com.zw.yzk.kabu.domain.executor.ThreadExecutor;
import com.zw.yzk.kabu.domain.interactor.DefaultUseCase;
import com.zw.yzk.kabu.domain.repository.Repository;
import com.zw.yzk.kabu.domain.repository.UseCase;

import javax.inject.Named;

import dagger.Module;
import dagger.Provides;

/**
 * Created by zhanwei on 2017/1/16.
 */

@Module
public class GoodsDetailsModule {

    @Provides
    @Named("goodsDetailsRepository")
    Repository provideRepository(GoodsDetailsRepository repository) {
        return repository;
    }

    @Provides
    @Named("goodsDetailsTokenUseCase")
    UseCase provideUseCase(ExecutionThread thread, ThreadExecutor executor, @Named("goodsDetailsRepository")Repository repository) {
        return new DefaultUseCase(thread, executor, repository);
    }
}
